<template>
  <div class="street">
    <div class="search bg-ff pd-10 after b-r-5">
      <div class="title t-c f-w-b" style="color: #333; font-size: 14px; line-height: 33px">实地排名</div>
    </div>
    <div class="box bg-ff b-r-5 mt-10" >
      <ul class="list after" v-if="list.length">
        <div class="left">
          <li v-for="(item, index) in list.slice(0, 5)" :key="index">
            <p>{{ index + 1 }} : {{ item.name }}</p>
            <p :style="{ width: item.score + '%' }">{{ item.score }}</p>
          </li>
        </div>
        <div class="right">
          <li v-for="(item, index) in list.slice(5, 10)" :key="index">
            <p>{{ index + 6 }} : {{ item.name }}</p>
            <p :style="{ width: item.score + '%' }">{{ item.score }}</p>
          </li>
        </div>
      </ul>
      <empty info="暂时没有数据" v-else></empty>
    </div>
  </div>
</template>
<script>
export default {
  props: ["list"],
};
</script>

<style scoped>
/* 排行榜 */
.list {
  padding: 20px;
}
.list .left {
  width: calc(50% - 10px);
}
.list .right {
  width: calc(50% - 10px);
}
.list li:nth-of-type(n + 2) {
  margin-top: 15px;
}
.list li:nth-of-type(2n) {
  margin-right: 0;
}
.list li p {
  margin: 0;
}
.list li p:nth-of-type(1) {
  color: #666;
}
.list li p:nth-of-type(2) {
  background-color: #c0c4cc;
  color: #fff;
  line-height: 23px;
  padding: 0 10px;
  border-radius: 3px;
  margin-top: 15px;
  min-width: 10%;
  box-sizing: border-box;
}
.list .left li:nth-of-type(1) p:nth-of-type(2) {
  background-color: #e0b330;
}
.list .left li:nth-of-type(2) p:nth-of-type(2) {
  background-color: #d2cfca;
}
.list .left li:nth-of-type(3) p:nth-of-type(2) {
  background-color: #dab08f;
}
</style>